/* ===================================
   Islamic Laws Website - CSS Styles
   Modern, Professional, Responsive Design
   =================================== */

/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #333333;
    background-color: #F9F6F0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><g fill="none" fill-rule="evenodd"><g fill="%23008080" fill-opacity="0.03"><polygon points="30 0 60 30 30 60 0 30"/></g></g></svg>');
    background-attachment: fixed;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: #008080;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1.1rem;
}

p {
    margin-bottom: 1em;
    line-height: 1.7;
}

a {
    color: #008080;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #D4AF37;
}

/* ===== LAYOUT UTILITIES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* ===== HEADER STYLES (Updated for Bootstrap Integration) ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 128, 128, 0.2);
}

.navbar-brand {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Header image section */
header {
    background-color: #F9F6F0;
    border-bottom: 1px solid rgba(0, 128, 128, 0.1);
}

header img {
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.02);
}

/* Navigation Styles */
.nav-list {
    display: none;
    list-style: none;
    gap: 2rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #008080;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.nav-list.active {
    display: flex;
}

.nav-list li a {
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
}

.nav-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #D4AF37;
}

@media (min-width: 768px) {
    .nav-list {
        display: flex;
        position: static;
        flex-direction: row;
        background: none;
        box-shadow: none;
        padding: 0;
    }
    
    .nav-list li a {
        text-align: left;
        padding: 0.5rem 1rem;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav {
    position: relative;
}

/* ===== MAIN CONTENT STYLES (Enhanced Card Layout) ===== */
.main-content {
    background: linear-gradient(135deg, #F9F6F0 0%, #ffffff 100%);
    min-height: 70vh;
    padding: 3rem 0;
}

/* Welcome Card Styles */
.welcome-card {
    background: linear-gradient(135deg, #008080 0%, #006666 100%);
    color: white;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><polygon points="30 0 60 30 30 60 0 30"/></g></g></svg>');
    pointer-events: none;
}

.welcome-card .card-body {
    position: relative;
    z-index: 1;
}

.welcome-card .lead {
    font-size: 1.3rem;
    line-height: 1.7;
    font-weight: 400;
}

.welcome-icon {
    animation: float 3s ease-in-out infinite;
}

/* Content Cards */
.content-card {
    border: none;
    border-radius: 15px;
    transition: all 0.4s ease;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 128, 128, 0.15) !important;
}

.content-card .card-header {
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

.content-card .card-title {
    font-family: 'Lora', serif;
    font-size: 1.4rem;
    margin-bottom: 0;
}

.content-card .card-body {
    padding: 2rem 1.5rem;
}

.content-card h5 {
    font-family: 'Lora', serif;
    font-weight: 600;
    margin-bottom: 1rem;
}

.content-card .list-unstyled li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.content-card .list-unstyled li:hover {
    background-color: rgba(0, 128, 128, 0.05);
    padding-left: 0.5rem;
    border-radius: 5px;
}

.content-card .list-unstyled li:last-child {
    border-bottom: none;
}

/* Sources Card */
.sources-card .card-header {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%) !important;
    border: none;
}

/* Transmission Card Timeline */
.timeline-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 150px;
}

.timeline-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.timeline-icon:hover {
    transform: scale(1.1);
}

.timeline-arrow {
    font-size: 1.5rem;
    color: #008080;
    font-weight: bold;
    margin: 0 1rem;
}

.timeline-content h6 {
    font-family: 'Lora', serif;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Resources Card */
.resource-item {
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.resource-item:hover {
    background-color: rgba(0, 128, 128, 0.05);
    transform: translateY(-3px);
}

.resource-item i {
    transition: all 0.3s ease;
}

.resource-item:hover i {
    transform: scale(1.1);
}

/* Welcome Icon Styles */
.welcome-icon i {
    font-size: 2.5rem;
    color: #008080;
}

/* Resource Icon Styles */
.resource-icon {
    font-size: 2rem;
}

/* Button Enhancements */
.btn {
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #008080 0%, #006666 100%);
    border: none;
}

.btn-outline-primary {
    border: 2px solid #008080;
    color: #008080;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #008080 0%, #006666 100%);
    border-color: #008080;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline-container {
        flex-direction: column;
    }
    
    .timeline-arrow {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }
    
    .welcome-card .lead {
        font-size: 1.1rem;
    }
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    background-color: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.search-form:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    color: #333333;
    background: transparent;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    background-color: #D4AF37;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #B8941F;
}

.search-button svg {
    display: block;
}

/* ===== MAIN CONTENT SECTIONS ===== */
.main {
    min-height: calc(100vh - 200px);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #008080;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: #D4AF37;
    margin: 1rem auto;
    border-radius: 2px;
}

/* ===== ENHANCED LINK STYLES ===== */
.content-text a {
    color: #008080;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.content-text a:hover {
    color: #D4AF37;
    border-bottom-color: #D4AF37;
    text-decoration: none;
}

.content-text a[target="_blank"]:after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
}

/* Text decoration utilities */
.text-decoration-underline {
    text-decoration: underline !important;
}

/* Responsive text sizing */
@media (max-width: 768px) {
    .content-text h5 {
        font-size: 1.2rem;
    }
    
    .content-text {
        font-size: 0.95rem;
    }
}

/* ===== POPULAR RULINGS SECTION ===== */
.popular-rulings {
    padding: 5rem 0;
    background-color: #F9F6F0;
}

.rulings-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .rulings-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ruling-item {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid #008080;
}

.ruling-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ruling-title {
    color: #008080;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.ruling-excerpt {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.ruling-link {
    color: #D4AF37;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ruling-link:hover {
    color: #008080;
}

/* ===== COMPREHENSIVE FOOTER STYLES ===== */
.footer-section {
    background: linear-gradient(135deg, #008080 0%, #006666 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><polygon points="20 0 40 20 20 40 0 20"/></g></g></svg>');
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #D4AF37 0%, #B8941F 50%, #D4AF37 100%);
}

/* Footer Widget Styles */
.footer-widget {
    margin-bottom: 2rem;
}

.footer-title {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-subtitle {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #D4AF37;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.footer-links li:hover {
    transform: translateX(5px);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    border-radius: 4px;
}

.footer-links a:hover {
    color: #D4AF37;
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 0.5rem;
    text-decoration: none;
}

.footer-links a i {
    width: 16px;
    margin-right: 0.5rem;
    opacity: 0.7;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.4s ease;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background-color: #D4AF37;
    color: white;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
    text-decoration: none;
}

/* Quote Section Enhanced */
.quote-section {
    background: rgba(0, 128, 128, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-left: 4px solid #D4AF37;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 900px;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.quote-icon {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #D4AF37;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.quote-text {
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #0D8686;
    line-height: 1.7;
    margin: 1rem 0;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.quote-author {
    color: #D4AF37;
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-top: 1rem;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.tagline {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.tagline .text-warning {
    color: #D4AF37 !important;
    font-weight: 600;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-section {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-widget {
        margin-bottom: 2.5rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .quote-text {
        font-size: 1.1rem;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-bottom .col-md-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .footer-title {
        font-size: 1.3rem;
    }
    
    .footer-subtitle {
        font-size: 1rem;
    }
    
    .quote-section {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .quote-text {
        font-size: 1rem;
    }
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .ruling-item {
        padding: 1.5rem;
    }
}

/* ===== ACCESSIBILITY & FOCUS STYLES ===== */
*:focus {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ENHANCED ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slide-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.7s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.7s ease-out;
}

/* Staggered Animation Delays */
.content-card:nth-child(1) {
    animation-delay: 0.1s;
}

.content-card:nth-child(2) {
    animation-delay: 0.2s;
}

.content-card:nth-child(3) {
    animation-delay: 0.3s;
}

.content-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Hover Animations */
.content-card:hover .card-title {
    animation: pulse 0.6s ease-in-out;
}

.timeline-icon:hover {
    animation: pulse 0.4s ease-in-out;
}

/* Loading Animation for Cards */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .search-container {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .category-card,
    .ruling-item {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}